*******************************************
********** Descriptive Statistics *********
*******************************************

*******************************************************
*** Description of important variables used (if not described in code): 
* dn_EF2101U1_TypA_sum_mean - Monthly average net electricity generation in levels
* EF1201U1_mean - Gross available capacity in levels
* tr95_dn_fuel_efficiency_gross -
* mon_anl2_sum - Number of monthly reports for output
* mon_eins_sum - Number of monthly reports for fuel input
* mbe_monate_sum - Number of monthly reports for labor input
*** 
*******************************************************




*** 85 percent of fossil fuel electricity generation in Germany on average (2003-2012):
* Comparison of gross electricity generation in sample divided by gross fossil residual demand
	tabstat da_share_generation_conv, by(jahr) statistics(mean) save
		tabstatmat x
		mat2txt, matrix(x) saving(tab_gen_sample_conv_share.csv) replace

* Comparison with electricity generation with information on age (match with Kraftwerksliste)
	tabstat da_share_generation_conv_match, by(jahr) statistics(mean) save
		tabstatmat x
		mat2txt, matrix(x) saving(tab_gen_sample_conv_share_match.csv) replace

*** Annual ETS intesities (Figure 1 is generated in separated R code)	
tabstat tr95_ti_eff if tr95_ti_eff <., statistics(count mean sd range p10 p25 p50 p75 p90) by(jahr) missing save
		tabstatmat x
		mat2txt, matrix(x) saving(tab_tr95_ti_eff_level_tr95.csv) replace 	
	forvalues i = 1(1)3{
	tabstat tr95_ti_eff if tr95_ti_eff <. & dn_fuel_type_plant == `i', statistics(count mean sd range p10 p25 p50 p75 p90) by(jahr) missing save
		tabstatmat x
		mat2txt, matrix(x) saving(tab_tr95_ti_eff_`i'_tr95.csv) replace 
	}


*** Differences between whole sample and labor demand sample (based on specification in column 4)
capture noisily quietly xi: xtabond2 l wage k tr95_ti_eff_exp y i.jahr if tr95_ti_eff <., gmm(y, lag(2 .)) iv(dn_y_competitor_mo_ee wage k tr95_z_ti_eff_exp i.jahr) nolevel robust orthogonal twostep
generate in_model4 = e(sample)


* Share of fossil fuel electricity generation in labor demand sample in whole sample
	tabstat da_generation_sample_conv_l if in_model4 == 1 & tr95_ti_eff <., statistics(mean) by(jahr) missing save
		tabstatmat x
		mat2txt, matrix(x) saving(tab_share_generation_l.csv) replace 	

* Bottleneck capacity in labor demand sample
	tabstat k_level if in_model4 == 1 & tr95_ti_eff <., statistics(count mean sd range p10 p25 p50 p75 p90) by(jahr) missing save
		tabstatmat x
		mat2txt, matrix(x) saving(tab_k_level_l_tr95.csv) replace 	
	forvalues i = 1(1)3{
	tabstat k_level if in_model4 == 1 & tr95_ti_eff <. & dn_fuel_type_plant == `i', statistics(count mean sd range p10 p25 p50 p75 p90) by(jahr) missing save
		tabstatmat x
		mat2txt, matrix(x) saving(tab_k_level_l_`i'_tr95.csv) replace 
	}

* Output in labor demand sample
	tabstat y_level if in_model4 == 1 & tr95_ti_eff <., statistics(count mean sd range p10 p25 p50 p75 p90) by(jahr) missing save
		tabstatmat x
		mat2txt, matrix(x) saving(tab_y_level_l_tr95.csv) replace 
	forvalues i = 1(1)3{
	tabstat y_level if in_model4 == 1 & tr95_ti_eff <. & dn_fuel_type_plant == `i', statistics(count mean sd range p10 p25 p50 p75 p90) by(jahr) missing save
		tabstatmat x
		mat2txt, matrix(x) saving(tab_y_level_l_`i'_tr95.csv) replace 
	}
		

* ETS intensity in labor demand sample
	tabstat tr95_ti_eff if in_model4 == 1 & tr95_ti_eff <., statistics(count mean sd range p10 p25 p50 p75 p90) by(jahr) missing save
		tabstatmat x
		mat2txt, matrix(x) saving(tab_tr95_ti_eff_level_l_tr95.csv) replace 	
	forvalues i = 1(1)3{
	tabstat tr95_ti_eff if in_model4 == 1 & tr95_ti_eff <. & dn_fuel_type_plant == `i', statistics(count mean sd range p10 p25 p50 p75 p90) by(jahr) missing save
		tabstatmat x
		mat2txt, matrix(x) saving(tab_tr95_ti_eff_l_`i'_tr95.csv) replace 
	}


* ETS ex-ante exposure in labor demand sample
	tabstat tr95_z if in_model4 == 1 & tr95_ti_eff <., statistics(count mean sd range p10 p25 p50 p75 p90) by(jahr) missing save
		tabstatmat x
		mat2txt, matrix(x) saving(tab_tr95_z_l_tr95.csv) replace 	
	forvalues i = 1(1)3{
	tabstat tr95_z if in_model4 == 1 & tr95_ti_eff <. & dn_fuel_type_plant == `i', statistics(count mean sd range p10 p25 p50 p75 p90) by(jahr) missing save
		tabstatmat x
		mat2txt, matrix(x) saving(tab_tr95_z_l_`i'_tr95.csv) replace 
	}

* Fuel efficiency (inverese of heat rate) in labor demand sample	
	tabstat dn_fuel_efficiency_gross if in_model4 == 1 & tr95_ti_eff <., statistics(count mean sd range p10 p25 p50 p75 p90) by(jahr) missing save
		tabstatmat x
		mat2txt, matrix(x) saving(tab_dn_fuel_efficiency_gross_level_l_tr95.csv) replace 	
	forvalues i = 1(1)3{
	tabstat dn_fuel_efficiency_gross if in_model4 == 1 & tr95_ti_eff <. & dn_fuel_type_plant == `i', statistics(count mean sd range p10 p25 p50 p75 p90) by(jahr) missing save
		tabstatmat x
		mat2txt, matrix(x) saving(tab_dn_fuel_efficiency_gross_l_`i'_tr95.csv) replace 
	}	
	
	
* Wages in labor demand sample	
	tabstat wage_level if in_model4 == 1 & tr95_ti_eff <., statistics(count mean sd range p10 p25 p50 p75 p90) by(jahr) missing save
		tabstatmat x
		mat2txt, matrix(x) saving(tab_wage_level_l_tr95.csv) replace 	
	forvalues i = 1(1)3{
	tabstat wage_level if in_model4 == 1 & tr95_ti_eff <. & dn_fuel_type_plant == `i', statistics(count mean sd range p10 p25 p50 p75 p90) by(jahr) missing save
		tabstatmat x
		mat2txt, matrix(x) saving(tab_wage_level_l_`i'_tr95.csv) replace 
}	

* Labor in labor demand sample
tabstat dn_mbe_EF24_sum_mean if in_model4 == 1 & tr95_ti_eff <., statistics(count mean sd range p10 p25 p50 p75 p90) by(jahr) missing save
		tabstatmat x
		mat2txt, matrix(x) saving(tab_labor_level_l_tr95.csv) replace 	
	forvalues i = 1(1)3{
	tabstat dn_mbe_EF24_sum_mean if in_model4 == 1 & tr95_ti_eff <. & dn_fuel_type_plant == `i', statistics(count mean sd range p10 p25 p50 p75 p90) by(jahr) missing save
		tabstatmat x
		mat2txt, matrix(x) saving(tab_labor_level_l_`i'_tr95.csv) replace 
}		

	
*** Differences between single and multi unit plants	

* Summary statistics for multi unit plants
	foreach j of var count_unique_bnr k_level dn_mbe_EF24_sum_mean m_level y_level inv_mach_level dn_cf_gr_elec_mon tr95_ti_eff tr95_z dn_fuel_efficiency_gross{ 
	tabstat `j' if tr95_ti_eff <. & EF1101U1_TypA_mean > 1, statistics(count mean sd range p10 p25 p50 p75 p90) by(jahr) missing save
		tabstatmat x
		mat2txt, matrix(x) saving(tab_`j'_single_tr95.csv) replace 	
	forvalues i = 1(1)3{
	tabstat `j' if tr95_ti_eff <. & dn_fuel_type_plant == `i' & EF1101U1_TypA_mean > 1, statistics(count mean sd range p10 p25 p50 p75 p90) by(jahr) missing save
		tabstatmat x
		mat2txt, matrix(x) saving(tab_`j'_`i'_single_tr95.csv) replace 
	}
	}

* Summary statistics for single unit plants
	foreach j of var count_unique_bnr k_level dn_mbe_EF24_sum_mean m_level y_level inv_mach_level dn_cf_gr_elec_mon tr95_ti_eff tr95_z dn_fuel_efficiency_gross{ 
	tabstat `j' if tr95_ti_eff <. & EF1101U1_TypA_mean == 1, statistics(count mean sd range p10 p25 p50 p75 p90) by(jahr) missing save
		tabstatmat x
		mat2txt, matrix(x) saving(tab_`j'_multi_tr95.csv) replace 	
	forvalues i = 1(1)3{
	tabstat `j' if tr95_ti_eff <. & dn_fuel_type_plant == `i' & EF1101U1_TypA_mean == 1, statistics(count mean sd range p10 p25 p50 p75 p90) by(jahr) missing save
		tabstatmat x
		mat2txt, matrix(x) saving(tab_`j'_`i'_multi_tr95.csv) replace 
	}
	}
	
	
*** Data underlying Figure C-1 (figure generated in separate R code)
* bi_Code3001: "Technische Anlagen und Maschinen einschliesslich Betriebs- und Geschaeftsausstattung" ("Investments in machinery including office and business expenses")
	preserve 
	collapse (sum) bi_Code3001, by(dn_fuel_type_plant jahr)
	outsheet using bi_Code3001_fuel_jahr_sum.txt, replace
	restore

	
	
*** Data underlying Figure C-2 (figure generated in separate R code)
	* Percentiles by fuel efficiency (over all technologies)
	capture noisily _pctile tr95_dn_fuel_eff_gr_0304, p(25 50 75)
	capture noisily quietly return list
	gen bin = 1 if !missing(tr95_dn_fuel_eff_gr_0304)
	quietly forval j = 1/3 {
		replace bin = bin + 1 if tr95_dn_fuel_eff_gr_0304 > r(r`j')
	}
	forval j = 1/4{
	tabstat inv_mach1 if bin == `j', statistics(count mean) by(jahr) missing save
		tabstatmat x
		mat2txt, matrix(x) saving(tr95_investments_by_efficiency_bin`j'.csv) replace
	}
	
	
	
	
*** Data underlying Figure C-2 (figure generated in separate R code)
	tabstat inv_mach_level if tr95_ti_eff <., statistics(count mean sd range p10 p25 p50 p75 p90) by(jahr) missing save
		tabstatmat x
		mat2txt, matrix(x) saving(tab_inv_mach_level_tr95.csv) replace  
	forvalues i = 1(1)3{
	tabstat inv_mach_level if dn_fuel_type_plant == `i' & tr95_ti_eff <., statistics(count mean sd range p10 p25 p50 p75 p90) by(jahr) missing save
		tabstatmat x
		mat2txt, matrix(x) saving(tab_inv_mach_level_`i'_tr95.csv) replace	
	}

*** Summary statistics for all years (underlying data for Tables D-1 - D-3, Tables generated in separate R code)

* Bottleneck capacity
	tabstat k_level if tr95_ti_eff <., statistics(count mean sd range p10 p25 p50 p75 p90) by(jahr) missing save
		tabstatmat x
		mat2txt, matrix(x) saving(tab_k_level_tr95.csv) replace 	
	forvalues i = 1(1)3{
	tabstat k_level if tr95_ti_eff <. & dn_fuel_type_plant == `i', statistics(count mean sd range p10 p25 p50 p75 p90) by(jahr) missing save
		tabstatmat x
		mat2txt, matrix(x) saving(tab_k_level_`i'_tr95.csv) replace 
	}

* Labor input
	tabstat dn_mbe_EF24_sum_mean if tr95_ti_eff <., statistics(count mean sd range p10 p25 p50 p75 p90) by(jahr) missing save
		tabstatmat x
		mat2txt, matrix(x) saving(tab_l_levels_tr95.csv) replace  
	forvalues i = 1(1)3{
	tabstat dn_mbe_EF24_sum_mean if dn_fuel_type_plant == `i' & tr95_ti_eff <., statistics(count mean sd range p10 p25 p50 p75 p90) by(jahr) missing save
		tabstatmat x
		mat2txt, matrix(x) saving(tab_l_levels_`i'_tr95.csv) replace	
	}


* Fuel input
	tabstat m_level if tr95_ti_eff <., statistics(count mean sd range p10 p25 p50 p75 p90) by(jahr) missing save
		tabstatmat x
		mat2txt, matrix(x) saving(tab_m_level_tr95.csv) replace  
	forvalues i = 1(1)3{
	tabstat m_level if dn_fuel_type_plant == `i' & tr95_ti_eff <., statistics(count mean sd range p10 p25 p50 p75 p90) by(jahr) missing save
		tabstatmat x
		mat2txt, matrix(x) saving(tab_m_level_`i'_tr95.csv) replace	
	}	


* Wages 
	tabstat wage_level if tr95_ti_eff <., statistics(count mean sd range p10 p25 p50 p75 p90) by(jahr) missing save
		tabstatmat x
		mat2txt, matrix(x) saving(tab_wage_level_tr95.csv) replace 	
	forvalues i = 1(1)3{
	tabstat wage_level if tr95_ti_eff <. & dn_fuel_type_plant == `i', statistics(count mean sd range p10 p25 p50 p75 p90) by(jahr) missing save
		tabstatmat x
		mat2txt, matrix(x) saving(tab_wage_level_`i'_tr95.csv) replace 
}	
	
	
* Output		
	tabstat y_level if tr95_ti_eff <., statistics(count mean sd range p10 p25 p50 p75 p90) by(jahr) missing save
		tabstatmat x
		mat2txt, matrix(x) saving(tab_y_level_tr95.csv) replace 	
	forvalues i = 1(1)3{
	tabstat y_level if tr95_ti_eff <. & dn_fuel_type_plant == `i', statistics(count mean sd range p10 p25 p50 p75 p90) by(jahr) missing save
		tabstatmat x
		mat2txt, matrix(x) saving(tab_y_level_`i'_tr95.csv) replace 
	}


* Total investment
	tabstat inv_level if tr95_ti_eff <., statistics(count mean sd range p10 p25 p50 p75 p90) by(jahr) missing save
		tabstatmat x
		mat2txt, matrix(x) saving(tab_inv_level_tr95.csv) replace  
	forvalues i = 1(1)3{
	tabstat inv_level if dn_fuel_type_plant == `i' & tr95_ti_eff <., statistics(count mean sd range p10 p25 p50 p75 p90) by(jahr) missing save
		tabstatmat x
		mat2txt, matrix(x) saving(tab_inv_level_`i'_tr95.csv) replace	
	}
	
	
* Investment in machinery (generated earlier in this do file)
	/*
	tabstat inv_mach_level if tr95_ti_eff <., statistics(count mean sd range p10 p25 p50 p75 p90) by(jahr) missing save
		tabstatmat x
		mat2txt, matrix(x) saving(tab_inv_mach_level_tr95.csv) replace  
	forvalues i = 1(1)3{
	tabstat inv_mach_level if dn_fuel_type_plant == `i' & tr95_ti_eff <., statistics(count mean sd range p10 p25 p50 p75 p90) by(jahr) missing save
		tabstatmat x
		mat2txt, matrix(x) saving(tab_inv_mach_level_`i'_tr95.csv) replace	
	}
	*/


* Large investment in machinery - binary
	tabstat inv_mach_large if tr95_z <., statistics(count mean sd range p10 p25 p50 p75 p90) by(jahr) missing save
		tabstatmat x
		mat2txt, matrix(x) saving(tab_inv_mach_large_binary_tr95.csv) replace 	
	forvalues i = 1(1)3{
	tabstat inv_mach_large if tr95_z <. & dn_fuel_type_plant == `i', statistics(count mean sd range p10 p25 p50 p75 p90) by(jahr) missing save
		tabstatmat x
		mat2txt, matrix(x) saving(tab_inv_mach_large_binary_`i'_tr95.csv) replace 
	}
	
	
	
* Capacity factor	
	tabstat dn_cf_gr_elec_mon if tr95_ti_eff <., statistics(count mean sd range p10 p25 p50 p75 p90) by(jahr) missing save
		tabstatmat x
		mat2txt, matrix(x) saving(tab_10_tr95.csv) replace  
	forvalues i = 1(1)3{
	tabstat dn_cf_gr_elec_mon if dn_fuel_type_plant == `i' & tr95_ti_eff <., statistics(count mean sd range p10 p25 p50 p75 p90) by(jahr) missing save
		tabstatmat x
		mat2txt, matrix(x) saving(tab_10_`i'_tr95.csv) replace	
	}

* ETS ex-ante exposure	
	tabstat tr95_z, statistics(count mean sd range p10 p25 p50 p75 p90) by(jahr) missing save
		tabstatmat x
		mat2txt, matrix(x) saving(tab_40.csv) replace 
	forvalues i = 1(1)3{
	tabstat tr95_z if dn_fuel_type_plant == `i', statistics(count mean sd range p10 p25 p50 p75 p90) by(jahr) missing save
		tabstatmat x
		mat2txt, matrix(x) saving(tab_40_`i'.csv) replace 
	}	
	
* ETS intensity (generated earlier in this do file)
	/*
	tabstat tr95_ti_eff if tr95_ti_eff <., statistics(count mean sd range p10 p25 p50 p75 p90) by(jahr) missing save
		tabstatmat x
		mat2txt, matrix(x) saving(tab_tr95_ti_eff_level_tr95.csv) replace 	
	forvalues i = 1(1)3{
	tabstat tr95_ti_eff if tr95_ti_eff <. & dn_fuel_type_plant == `i', statistics(count mean sd range p10 p25 p50 p75 p90) by(jahr) missing save
		tabstatmat x
		mat2txt, matrix(x) saving(tab_tr95_ti_eff_`i'_tr95.csv) replace 
	}
	*/

* Fuel price ex-ante exposure
	tabstat tr95_fp_eff_z, statistics(count mean sd range p10 p25 p50 p75 p90) by(jahr) missing save
		tabstatmat x
		mat2txt, matrix(x) saving(tab_50.csv) replace 	
	forvalues i = 1(1)3{
	tabstat tr95_fp_eff_z if dn_fuel_type_plant == `i', statistics(count mean sd range p10 p25 p50 p75 p90) by(jahr) missing save
		tabstatmat x
		mat2txt, matrix(x) saving(tab_50_`i'.csv) replace 
	}

* Fuel Price intensity
	tabstat tr95_fp_eff, statistics(count mean sd range p10 p25 p50 p75 p90) by(jahr) missing save
		tabstatmat x
		mat2txt, matrix(x) saving(tab_46.csv) replace 	
	forvalues i = 1(1)3{
	tabstat tr95_fp_eff if dn_fuel_type_plant == `i', statistics(count mean sd range p10 p25 p50 p75 p90) by(jahr) missing save
		tabstatmat x
		mat2txt, matrix(x) saving(tab_46_`i'.csv) replace 
	}

	

* Available capacity (conventional)
	tabstat EF1101U3_TypA_mean if tr95_z <., statistics(count mean sd range p10 p25 p50 p75 p90) by(jahr) missing save
		tabstatmat x
		mat2txt, matrix(x) saving(tab_available_capacity_conv_tr95.csv) replace 	
	forvalues i = 1(1)3{
	tabstat EF1101U3_TypA_mean if tr95_z <. & dn_fuel_type_plant == `i', statistics(count mean sd range p10 p25 p50 p75 p90) by(jahr) missing save
		tabstatmat x
		mat2txt, matrix(x) saving(tab_available_capacity_conv_`i'_tr95.csv) replace 
	}
	

* Between and within variation in bottleneck capacity, available capacity (all), available capacity (conventional) 
	xtsum k_level EF1101U3_TypA_mean
	xtsum k_level EF1101U3_TypA_mean if tr95_z <. 
	xtsum k_level EF1101U3_TypA_mean if in_model4 == 1 & tr95_ti_eff <.

	
	
*** Summary statistics for regressions (Underlying data for Table D4) based on specifications in Table 1 with ETS TI (columns 4-5)	
* Estimate in levels to get untransformed data set:
capture noisily quietly xi: xtabond2 m tr95_ti_eff tr95_fp_eff y i.jahr, gmm(y, lag(2 .)) iv(dn_y_competitor_mo_ee tr95_z_ti_eff tr95_fp_eff_z i.jahr) robust orthogonal twostep
tabstat dn_EF2101U1_TypA_sum_mean EF1101U3_TypA_mean wage_level inv_level inv_mach inv_mach_large m l wage k tr95_z tr95_fp_eff_z y dn_y_competitor_mo_ee tr95_ti_eff tr95_fp_eff k_level dn_mbe_EF24_sum_mean m_level y_level inv_mach_level dn_cf_gr_elec_mon inv_mach_large EF1201U1_mean tr95_dn_fuel_efficiency_gross tr95_dn_fuel_eff_gr_0304 dn_fuel_efficiency_gross dn_fuel_eff_gr_0304 mon_anl2_sum mon_eins_sum mbe_monate_sum if e(sample), statistics(count mean sd range p10 p25 p50 p75 p90) missing save
		tabstatmat x
		mat2txt, matrix(x) saving(tab_fuel_eq_col45_tr95.csv) replace 	
	forvalues i = 1(1)3{
	tabstat dn_EF2101U1_TypA_sum_mean EF1101U3_TypA_mean inv_level wage_level inv_mach inv_mach_large m l wage k tr95_z tr95_fp_eff_z y dn_y_competitor_mo_ee tr95_ti_eff tr95_fp_eff k_level dn_mbe_EF24_sum_mean m_level y_level inv_mach_level dn_cf_gr_elec_mon inv_mach_large EF1201U1_mean tr95_dn_fuel_efficiency_gross tr95_dn_fuel_eff_gr_0304 dn_fuel_efficiency_gross dn_fuel_eff_gr_0304 mon_anl2_sum mon_eins_sum mbe_monate_sum if e(sample) & dn_fuel_type_plant == `i', statistics(count mean sd range p10 p25 p50 p75 p90) missing save
		tabstatmat x
		mat2txt, matrix(x) saving(tab_fuel_eq_col45_`i'_tr95.csv) replace 
	}


/*	
*** ETS ex-ante exposure (Underlying data for Figure D-1, figure generated in separate R code), necessary data already obtained earlier in this do file
	tabstat tr95_z if tr95_ti_eff <., statistics(count mean sd range p10 p25 p50 p75 p90) by(jahr) missing save
		tabstatmat x
		mat2txt, matrix(x) saving(tab_40.csv) replace 
	forvalues i = 1(1)3{
	tabstat tr95_z if tr95_ti_eff <. & dn_fuel_type_plant == `i', statistics(count mean sd range p10 p25 p50 p75 p90) by(jahr) missing save
		tabstatmat x
		mat2txt, matrix(x) saving(tab_40_`i'.csv) replace 
	}
*/
	
	
*** Average efficiency rate (inverse of heat rates) in 2003 and 2004 (Underlying data for Figure D-3, figure generated in separate R code)
	tabstat tr95_dn_fuel_eff_gr_0304 if tr95_ti_eff <., statistics(count mean sd range p10 p25 p50 p75 p90) by(jahr) missing save
		tabstatmat x
		mat2txt, matrix(x) saving(tab_39.csv) replace  
	forvalues i = 1(1)3{
	tabstat tr95_dn_fuel_eff_gr_0304 if tr95_ti_eff <. & dn_fuel_type_plant == `i', statistics(count mean sd range p10 p25 p50 p75 p90) by(jahr) missing save
		tabstatmat x
		mat2txt, matrix(x) saving(tab_39_`i'.csv) replace 
	}

*** Density of investments in Machinery per MW (underlying data for Figure F-1, figure generated in separate R code)
	preserve
	histogram ln_inv_mach_mw if tr95_ti_eff <., kdensity
	graph save ln_inv_mach_mw, replace
	serset use, clear
	outsheet using tr95_ln_inv_mach_mw.txt, replace
	restore	


*** Summary statistics on monthly reports (mentioned in Footnote 23)		
	tabstat mon_anl2_sum mon_eins_sum mbe_monate_sum if tr95_ti_eff <., statistics(count mean sd range p10 p25 p50 p75 p90) missing save
		tabstatmat x
		mat2txt, matrix(x) saving(mon_report_tr95.csv) replace 	
	forvalues i = 1(1)3{
	tabstat mon_anl2_sum mon_eins_sum mbe_monate_sum if tr95_ti_eff <. & dn_fuel_type_plant == `i', statistics(count mean sd range p10 p25 p50 p75 p90) missing save
		tabstatmat x
		mat2txt, matrix(x) saving(mon_report_`i'_tr95.csv) replace 
	}
	
	
exit
